import Vue from 'vue'
import VueRouter from 'vue-router'

import Layout from '@/layout/index.vue'

Vue.use(VueRouter)

const routes = [{
	path: '/',
	component: Layout,
	redirect: '/home',
	children: [{
		path: '/home',
		name: 'Home',
		component: () => import('../views/home'),
		meta: {
			title: '主页'
		}
	}, {
		path: '/about/index',
		name: 'About',
		component: () => import('../views/about'),
		meta: {
			title: '关于我们'
		}
	}, {
		path: '/about/price',
		name: 'Price',
		component: () => import('../views/about/price'),
		meta: {
			title: '价格'
		}
	}, {
		path: '/about/detail',
		name: 'Detail',
		component: () => import('../views/about/detail'),
		meta: {
			title: '详情'
		}
	}]
}]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
